package gang.org.springframework.framework.util;

import java.util.Collection;
import java.util.LinkedHashMap;

public abstract class GangCollectionUtils {

    static final float DEFAULT_LOAD_FACTOR = 0.75f;

    public static boolean isEmpty( Collection<?> collection) {
        return (collection == null || collection.isEmpty());
    }

    public static <K,V> LinkedHashMap<K,V> newLinkedHashMap(int expectedSize){

        return new LinkedHashMap<>((int) (expectedSize/DEFAULT_LOAD_FACTOR), DEFAULT_LOAD_FACTOR);
    }
}
